package com.lyc.servlet;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.lyc.dao.CountryInfoDAO;
import com.lyc.dao.imp.CountryInfoDAOImpl;

@WebServlet("/home.let")
public class HomeServlet extends HttpServlet {

	private CountryInfoDAO dao = new CountryInfoDAOImpl();

	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		try {
			req.setAttribute("list", dao.countMedal());
			req.getRequestDispatcher("/home.jsp").forward(req, resp);
		} catch (Exception ex) {
			throw new ServletException(ex.getMessage(), ex);
		}
	}

}
